﻿@model CNRegex.Web.Models.ModelAccountHome
@using CNRegex.Web.Base
@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<link href="@Url.Content("~/Content/css/AccountHome.css")" rel="stylesheet" type="text/css" />
<h2 class="rph_h2">@Model.Title</h2>

<ul class="rph_navigate">
	<li>
		<a href="/@Model.User.Name" class="rph_left_menu" style="color:White;">我的表达式</a>
		<div>
			<ul class="rph_navigate_category">
				@foreach (var item in Model.UserExpressionCategories)
				{
					<li class="@(Model.SelectCategoryName==item.Name&&Model.ExpressionType==CNRegex.Enum.EnumExpressionType.myExpression?"rph_select_category":"")">
						<a href="/@Model.User.Name?c=@item.Name&t=@((int)CNRegex.Enum.EnumExpressionType.myExpression)">@item.Name</a>
					</li>
				}
			</ul>
		</div>
	</li>
	<li>
		<a href="/@Model.User.Name/?t=@((int)CNRegex.Enum.EnumExpressionType.favoriteExpression)" class="rph_left_menu" style="color:White;">我的收藏</a>
		<div>
			<ul class="rph_navigate_category">
				@foreach (var item in Model.UserFavoriteCategories)
				{
					<li class="@(Model.SelectCategoryName == item.Name && Model.ExpressionType == CNRegex.Enum.EnumExpressionType.favoriteExpression ? "rph_select_category" : "")">
						<a href="/@Model.User.Name?c=@item.Name&t=@((int)CNRegex.Enum.EnumExpressionType.favoriteExpression)">@item.Name</a>
					</li>
				}
			</ul>
		</div>
	</li>
	<li>
		<a href="/@Model.User.Name/?t=@((int)CNRegex.Enum.EnumExpressionType.myArticle)" class="rph_left_menu" style="color:White;">我的文章</a>
		<div>
			<ul class="rph_navigate_category">
				@foreach (var item in Model.UserBlogCategories)
				{
					<li class="@(Model.SelectCategoryName == item.Name && Model.ExpressionType == CNRegex.Enum.EnumExpressionType.myArticle ? "rph_select_category" : "")">
						<a href="/@Model.User.Name?c=@item.Name&t=@((int)CNRegex.Enum.EnumExpressionType.myArticle)">@item.Name</a>
					</li>
				}
			</ul>
		</div>
	</li>
</ul>


<div class="rph_leftContent">
	@if(Model.ExpressionType== CNRegex.Enum.EnumExpressionType.myArticle){
		<ul>
		@for (int i = 0; i < Model.MyBlogs.Count(); i++)
		{
			<li @(i % 2 == 0 ? "" : "class=rph_liEven")>
				<h6>@Model.MyBlogs[i].Title</h6>
				<div class="rph_expression_content">
					@Model.MyBlogs[i].Summery
				</div>
				<div>
					<a href="/blog/edit/@Model.MyBlogs[i].ID/?c=@(Model.SelectCategoryName)&p=@Model.ExPaginate.PageNo">编辑</a>
				</div>
			</li>
		}
		</ul>
	}else{
	<ul>
		@for (int i = 0; i < Model.MyExpressions.Count(); i++)
		{
			<li @(i % 2 == 0 ? "" : "class=rph_liEven")>
				<h6>
					<a href="/RegexHome/Detail/@Model.MyExpressions[i].ID">@Model.MyExpressions[i].Title</a>
				</h6>
				<div class="rph_expression_content">
					@Model.MyExpressions[i].Expression
				</div>
				@if (Model.ExpressionType== CNRegex.Enum.EnumExpressionType.myExpression)
				{
					<div>
						<a href="/regex/edit/@Model.MyExpressions[i].ID/?c=@(Model.SelectCategoryName)&p=@Model.ExPaginate.PageNo">编辑</a>
						<span>分类:
							<a href="/@Model.User.Name?c=@Model.RegexCategories.First(x => x.ID == Model.MyExpressions[i].CategoryID).Name">@Model.RegexCategories.First(x => x.ID == Model.MyExpressions[i].CategoryID).Name</a>
						</span>
						<span>日期:@Model.MyExpressions[i].CreateDate.ToString("yyyy/MM/dd")</span>
					</div>
			}else{
				<div>
					<a href="#">取消收藏</a>
				</div>
			}
				
			</li>
		}
	</ul>
	 }
</div>
<div class="clear"></div>

@{
		Html.RenderPartial("/Views/Controls/Paginate.cshtml",Model.ExPaginate);
	}